import request from '@/utils/request'
//获取题型顺序
export const getQuestionTypesOrder = (ACSId, paperType) => {
    return request.get(`/exam/paper_info/desc?ACSId=${ACSId}&paperType=${paperType}`);
};
//提交题型顺序
export const submitQuestionTypesOrder = (data) => {
    // console.log("submitQuestionTypesOrder", data);
    return request.put(`/exam/paper_info/update`, data);
};
//为课程目标添加一种题型
export const addSingleTargetInfo = (data) => {
    // console.log("data",data);
    return request.post('/exam/quickfill/add', data);
};
//为课程目标删除一种题型
export const delSingleTargetInfo = (data) => {
    // console.log("delSingleTargetInfo",data);
    return request.delete(`/exam/quickfill/delete?id=${data}`);
};

// 更新全部课程目标的所含信息
export const updateTotalTarget = (data) => {
    return request.put(`/exam/quickfill/update`, data)
}
//获取全部信息
export const getTotalTarget = (paperType, subId,ACSId) => {
    // console.log(paperType, subId,"kzykzy");
    return request.get(`/exam/quickfill/get?ACSId=${ACSId}&paperType=${paperType}&subId=${subId}`)
}
//获取题型信息
export const getQuestionType = (ACSId, paperType) => {
    // console.log(paperType, subId,"kzykzy");
    return request.get(`/exam/T_exam_target_to_question/getnumByQuestionType?ACSId=${ACSId}&paper_type=${paperType}`)
}

// 获取课程目标对应分数信息
export const getTargetScore = (ACSId, paperType) => {
    // console.log(paperType, subId,"kzykzy");
    return request.get(`/exam/T_exam_target_to_question/getTargetTypecentage?ACSId=${ACSId}&paper_type=${paperType}`)
}
//获取试卷分析的表头
export const autoMakeXlsx_api = (paperType, ACSId) => {
    return request.post(`/exam/auto_produce_xlsx/create?ACSId=${ACSId}&paperType=${paperType}`, {
        responseType: 'blob' // 确保响应类型被设置为 'blob'
    });
}
//获取试卷分析的表头中课堂表现和课堂作业的列数
export const getPerformance_cols=(ACSId)=>{
    return request.get(`/achievement/target/num?ACSId=${ACSId}`)
}
// 获取达成度分析的数据
export const getAnalysis_data = (subId,ACSID,paperType,data) => {
    return request.post(`/achievement/course/desc?subId=${subId}&ACSID=${ACSID}&paperType=${paperType}`,data)
}
//获取题型赋值给下拉框
export const getQuestionsTypeForSelection = (subId) => {
    return request.get(`/exam/T_exam_question/type?subId=${subId}`)
}

//获取题型单题分值
export const getQuestionsSingleScore = (ACSId) => {
    return request.get(`/exam/T_question_score/find?ACSId=${ACSId}`)
}
//修改题型单题分值
export const updateQuestionsSingleScore = (ACSId, oneChoiceQuestions, multipleChoiceQuestions, fillBlankQuestions, judgeQuestions) => {
    return request.put(`/exam/T_question_score/update?ACSId=${ACSId}&oneChoiceQuestions=${oneChoiceQuestions}&multipleChoiceQuestions=${multipleChoiceQuestions}&fillBlankQuestions=${fillBlankQuestions}&judgeQuestions=${judgeQuestions}`)
}
//获取试卷中各个题型的分数
export const getScoreOfSpecificPaper = (ACSId,paperType) => {
    return request.get(`/exam/target_question/typeandnum?ACSId=${ACSId}&paperType=${paperType}`)
}
// 命题审批表的试卷信息（A B卷）
export const getPaperInfoAchievement = (ACSId, subId) => {
    return request.get(`/achievement/target/PaperInfoAchievement?ACSId=${ACSId}&subId=${subId}`)
}
// 可折叠图数据
export const getFoldableData = (ACSId, paperType) => {
    return request.get(`/exam/target_question/targetandtype?ACSId=${ACSId}&paperType=${paperType}`)
}
// 获取标签赋值给下拉框
export const getLabelForSelection = (subId) => {
    return request.get(`/exam/quickfill/label/get?subId=${subId}`)
}
// 添加标签
export const addLabelForTarget = (data) => {
    return request.post(`/exam/quickfill/label/post`,data)
    // return request.post(`/exam/quickfill/label/post?subId=${subId}&ACSID=${ACSID}&paperType=${paperType}`)
}
//为课程目标删除一种标签
export const delLabelForTarget = (targetId, labelId, paperType) => {
    return request.delete(`/exam/quickfill/label/delete?targetId=${targetId}&labelId=${labelId}&paperType=${paperType}`);
};